<template>
  <div>
    <el-button type="primary" size="mini" throttle="2000" @click="addHandler">btn++</el-button>
    <span>{{ number }}</span>
    <div style="margin-top: 30px">
      <el-button v-for="i in number" :key="i" @click="handleClick" throttle="1000" @trailing="handleTrailing">点我
      </el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "throttleBtn",
  data() {
    return {
      number: 1
    }
  },
  methods: {
    handleClick() {
      console.log('点击了，1s延迟')
    },
    handleTrailing() {
      console.log('别点了，等会点')
    },
    addHandler() {
      console.log('增加了，2s延迟')
      this.number += 100
    }
  }
}
</script>

<style scoped>

</style>
